package cn.yuxiaoyuan.feign;

import cn.yuxiaoyuan.constants.FeignServerNameConstants;
import cn.yuxiaoyuan.fallback.LoginFeignApiFallback;
import cn.yuxiaoyuan.pojo.dto.LoginDto;
import cn.yuxiaoyuan.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

@FeignClient(value = FeignServerNameConstants.ServerName.SERVICE_NAME_UAA,
        fallbackFactory = LoginFeignApiFallback.class,
        path =  FeignServerNameConstants.Prefix.PREFIX_UAA_REMOTE
        )
public interface LoginFeignApi {

    @PostMapping("/create")
    JSONResult create(@RequestBody @Valid LoginDto loginDto);
}
